<h1>Listing comments</h1>

<table>
  <tr>
    <th>Content</th>
    <th>User</th>
    <th>Product</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @comments.each do |comment| %>
  <tr>
    <td><%= comment.content %></td>
    <td><%= comment.user_id %></td>
    <td><%= comment.product_id %></td>
    <td><%= link_to 'Show', comment %></td>
    <td><%= link_to 'Edit', edit_comment_path(comment) %></td>
    <td><%= link_to 'Destroy', comment, method: :delete, data: { confirm: 'Are you sure?' } %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New Comment', new_comment_path %>
